/**
 * 
 */
package models;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;


/**
 * @author yujie
 *
 */
@Entity
public class WenJuanTi extends ShiTi  implements Comparable  {
	/**
	 * 单向映射关系：多个问卷题对应一个题库题
	 */
	@ManyToOne
	TiKuTi tiKuTi;
	/**
	 * 编号：问卷题在试卷中的编号
	 */
	int bianHao;
	/**
	 * 双向映射关系：多个问卷题对于一个问卷
	 */
	@ManyToOne
	WenJuan wenJuan;
	/* (non-Javadoc)
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	@Override
	public int compareTo(Object o) {
		WenJuanTi wenJuanTi2=(WenJuanTi)o;
		return bianHao-wenJuanTi2.bianHao; 
	}
	public WenJuanTi(TiKuTi tiKuTi, WenJuan wenJuan) {
		super();
		this.tiKuTi = tiKuTi;
		this.wenJuan = wenJuan;
	}
	
}
